<HTML><HEAD><TITLE>chr_trace</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(chr)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>chr_trace</H1>
Activates the standard debugger and shows constraint handling.


<DL>
</DL>
<H2>Description</H2>
   In order to use the standard debugger, the debug_compile must have been
   on (default) during compilation (chr to pl) and loading of the produced
   ECLiPSe  code.  The query chr_trace.  activates the standard debugger
   showing more information about the handling of constraints.  In the
   standard debugger, user-defined constraints are treated as predicates
   and the information about application of constraint handling rules is
   displayed without stopping.  The additional information displayed is:

<P>
  * add:  A new constraint is added to the constraint store.

<P>
  * already_in:  A constraint to be added was already present.

<P>
   The ports related to application of rules are:

<P>
  * try_rule:  A rule is tried.

<P>
  * delay_rule:  The last tried rule cannot fire because the guard did not
    succeed.

<P>
  * fire_rule:  The last tried rule fires.

<P>
   The ports related to labeling are:
  * try_label:  A label_with declaration is checked.

<P>
  * delay_label:  The last label_with declaration delays because the guard
    did not succeed.

<P>
  * fire_label:  The last tried label_with declaration succeeds, so the
    clauses of the associated constraint will be used for built-in
    labeling.

<P>
   When displayed, each constraint is labeled with a unique integer
   identifier.  Each rule is labeled with its name as given in the chr
   source using the @ operator.  If a rule does not have a name, it is
   displayed together with a unique integer identifier.

<P>

<H3>Fail Conditions</H3>
   None.


<H3>Resatisfiable</H3>
   No.
<H2>Examples</H2>
<PRE>   Success:
[eclipse]: chr_trace.
yes.
Debugger switched on - creep mode
[eclipse]: notrace.     % trace only constraints
Debugger switched off
yes.
[eclipse]: minimum(X,Y,Z), maximum(X,Y,Z).
% trace edited to show only firing rules

ADD (1) minimum(X, Y, Z)
TRY (1) minimum(_g218, _g220, _g222) with propagation
RULE 'propagation' FIRED

 ADD (2) leq(_g665, _g601)

 ADD (3) leq(_g665, Var)

ADD (4) maximum(_g601, Var, _g665)
TRY (4) maximum(_g601, Var, _g665) with propagation
RULE 'propagation' FIRED

 ADD (5) leq(_g601, _g665)
 TRY (5) leq(_g601, _g665) (2) leq(_g665, _g601) with antisymmetry
 RULE 'antisymmetry' FIRED

TRY (4) maximum(_g601, Var, _g601) with max_eq
RULE 'max_eq' FIRED

 ADD (6) leq(Var, _g601)
 TRY (3) leq(_g601, Var) (6) leq(Var, _g601) with antisymmetry
 RULE 'antisymmetry' FIRED

TRY (1) minimum(_g601, _g601, _g601) with min_eq
RULE 'min_eq' FIRED

 ADD (7) leq(_g601, _g601)
 TRY (7) leq(_g601, _g601) with reflexivity
 RULE 'reflexivity' FIRED

X = Y = Z = _g558
yes.



</PRE>
<H2>See Also</H2>
<A HREF="../../lib/chr/chr_opium-0.html">chr_opium / 0</A>, <A HREF="../../lib/chr/chr_notrace-0.html">chr_notrace / 0</A>
</BODY></HTML>
